package com.example.demo.gouzaoqi;

   class animal{
        public void move(){
            System.out.println("任何动物都可以移动");
        }
    }

     class dog extends animal{
        public void move(){
            System.out.println("狗可以走和跑");
        }
    }

        class cat extends animal{
            public void move(){
                System.out.println("猫可以上房");
            }
        }

public class donwgu {
    public static void main(String[] args) {
        animal a = new dog();
        a.move();
        animal b = new cat();
        b.move();
        animal c = new animal();
        c.move();
    }
}
